/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.digitalpoint.dao;

import br.com.digitalpoint.Funcionario;
import br.com.digitalpoint.Registro;
import br.com.digitalpoint.utils.FabricaConexao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.Date;

/**
 *
 * @author DSA
 */
public class RegistroDAO
{

    public void incluirPonto(Funcionario matr, Registro data) throws Exception
    {
        try
        {
            String insere = "INSERT INTO TBPonto VALUES (?,?)";
            Connection con = FabricaConexao.abreConexao();
            PreparedStatement ps = con.prepareStatement(insere);
            ps.setInt(1, matr.getMatricula());
            Date data1 = data.getDataRegistro();
            java.sql.Timestamp dtReg = new java.sql.Timestamp(data1.getTime());
            ps.setTimestamp(2, dtReg);
            ps.execute();
        }
        catch (Exception e)
        {
            throw e;
        }
    }
}

	

